#include <QtGui/QApplication>
#include <QtGui>
#include "mainwindow.h"
#include "thread_class.h"
#include "qpixmap.h"

int main(int argc, char *argv[])
{

    //QPixmap bgPix(":/images/bg.jpg");
    QApplication a(argc, argv);
    //QTextCodec::setCodecForTr(QTextCodec::codecForName("gb2312"));
    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
    MainWindow w;
    //ElevatorUart1Thread  elevator_uart1_thread(&w);
    //ElevatorUart2Thread  elevator_uart2_thread(&w);
    ElevatorUart1ReadThread elevator_uart1_read_thread(&w);
    elevator_uart1_read_thread.start();
    ElevatorUart2ReadThread elevator_uart2_read_thread(&w);
    elevator_uart2_read_thread.start();


    AES_encrypt_thread aes_thread(&w);
    aes_thread.start();
    TextUartThread text_uart_thread;
    //w.elevator_uart1_thread =&elevator_uart1_thread;
    //w.elevator_uart2_thread =&elevator_uart2_thread;
    w.elevator_uart1_read_thread = &elevator_uart1_read_thread;
    w.elevator_uart2_read_thread = &elevator_uart2_read_thread;
    w.text_uart_thread = &text_uart_thread;
    w.new_wiget();
    w.start_default(&w);
    //w.show();
    w.showFullScreen();
    QTimer::singleShot(100,&w,SLOT(ui_on_top()));
    return a.exec();
}
